﻿Imports DAO
Imports DTO

Public Class PhieuThuBUS
    Public Shared Function ThemPhieuThu(ByVal pt As PhieuThuDTO) As Boolean
        If PhieuThuDAO.GetPhieuThuByMa(pt.MaPhieuThu) Is Nothing Then
            PhieuThuDAO.Insert(pt)
            Return True
        Else
            Return False
        End If
    End Function

    Public Shared Function XoaPhieuThu(ByVal pt As PhieuThuDTO) As Boolean
        If PhieuThuDAO.GetPhieuThuByMa(pt.MaPhieuThu) IsNot Nothing Then
            PhieuThuDAO.Delete(pt)
            Return True
        Else
            Return False
        End If
    End Function

    Public Shared Function SuaPhieuThu(ByVal pt As PhieuThuDTO) As Boolean
        If PhieuThuDAO.GetPhieuThuByMa(pt.MaPhieuThu) IsNot Nothing Then
            PhieuThuDAO.Update(pt)
            Return True
        Else
            Return False
        End If
    End Function
End Class
